﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UClaimDemageList.aspx.cs"
    Inherits="IHISCETeim.Web.MachineSys.UserModel.UClaimDemageList" %>

<form id="pagerForm" method="post" action="UserModel/UClaimDemageList.aspx">
<input type="hidden" name="ShowAgentName" value="<%=ShowAgentName %>" />
<input type="hidden" name="CommonFiled" value="<%=CommonFiled %>" />
<input type="hidden" name="CommonValue" value="<%=CommonValue %>" />
<input type="hidden" name="UClaimType" value="<%=UClaimType %>" />
<input type="hidden" name="DownlineDateFrom" value="<%=DownlineDateFrom %>" />
<input type="hidden" name="DownlineDateTo" value="<%=DownlineDateTo %>" />
<input type="hidden" name="InDateFrom" value="<%=InDateFrom %>" />
<input type="hidden" name="InDateTo" value="<%=InDateTo %>" />
<input type="hidden" name="OnlyShow3MonthBefore" value="<%=OnlyShow3MonthBefore %>" />
<input type="hidden" name="orderField" value="<%=orderField %>" />
<input type="hidden" name="orderDirection" value="<%=orderDirection %>" />
<input type="hidden" name="pageNum" value="1" />
<input type="hidden" name="numPerPage" value="<%=numPerPage %>" />
</form>
<style>
    .UClaimDemageList_Row2 td{ border-bottom-width:1px!important; border-bottom-color:#000!important;}
</style>
 <script type="text/javascript">
     
     //所有已选中的代理商
     var $selectagentname_UClaimDemageList = "<%=ShowAgentName %>";
     function UClaimDemageListTreeCheck() {
         var json = arguments[0], result = "";
         if (json.checked) {
             $(json.items).each(function (i) {
                 // result += "<p>name:" + this.name + " value:" + this.value + " text: " + this.text + "</p>";
                 $selectagentname_UClaimDemageList += this.name + ",";
             });
         }
         else {
             $(json.items).each(function (i) {
                 $selectagentname_UClaimDemageList = $selectagentname_UClaimDemageList.replace(this.name + ",", "");
             });
         }
         $("#UClaimDemageList_ShowAgentName").val($selectagentname_UClaimDemageList);
     }
    </script>   
<form id="form1" runat="server" method="post" action="UserModel/UClaimDemageList.aspx" onsubmit="return navTabSearch(this);">
<div class="pageContent">    
              
    <div class="searchBar">
        <input type="hidden" id="UClaimDemageList_ShowAgentName" name="ShowAgentName" value="<%=ShowAgentName %>" />
        <table class="searchContent">
            <tr>
                <td rowspan="2">
                    <b>查询条件：</b>
                </td>
                <td>
                    <div class="agentlistdiv">
                        <div class="panelBar">
                            <ul class="toolBar"  > 
                                <li style=" float:right;"><a href="#" class="closeselectagent delete"><span>确定选择</span></a></li>
                            </ul>
                        </div>
                        <div class="agentlisttreecon" >                                    
                            <ul class="tree treeCheck" oncheck="UClaimDemageListTreeCheck">
                                <%=GetAgentList()%>
                            </ul>
                        </div>
                    </div>
                    <a href="#" class="openselectagent">选择代理商</a>
                </td>                
                <td>
                    <select name="CommonFiled" class="combox">
                        <option value="SerialNumber" <%=CommonFiled=="SerialNumber"?"selected":"" %>>机号</option>
                        <option value="ClaimsNumber" <%=CommonFiled=="ClaimsNumber"?"selected":"" %>>品情单号</option>
                        <option value="ItemCode" <%=CommonFiled=="ItemCode"?"selected":"" %>>物料号</option>
                        <option value="Dscription" <%=CommonFiled=="Dscription"?"selected":"" %>>物料名称</option>
                        <option value="DocNum" <%=CommonFiled=="DocNum"?"selected":"" %>>发货单号</option>
                        <option value="InOrderNum" <%=CommonFiled=="InOrderNum"?"selected":"" %>>旧件相关单号</option>
                    </select>
                 </td>
                <td>
                    等于：
                 </td>
                <td>
                    <input name="CommonValue" type="text"  style="width:80px;" value="<%=CommonValue %>" />
                </td>
                <td>
                    发货类型：
                </td>
                <td>
                     <select name="UClaimType" class="combox">
                        <option value="" <%=UClaimType==""?"selected":"" %>>请选择...</option>
                        <option value="SAP" <%=UClaimType=="SAP"?"selected":"" %>>SAP</option>
                        <option value="借件" <%=UClaimType=="借件"?"selected":"" %>>借件</option>
                        <option value="供应商提供" <%=UClaimType=="供应商提供"?"selected":"" %>>供应商提供</option>
                    </select>  
                </td>
                <td>
                    只显示欠品超过3个月
                    <input type="checkbox" name="OnlyShow3MonthBefore" value="true" <%=OnlyShow3MonthBefore?"checked":"" %> />
                </td>
                <td rowspan="2">
                    <div class="subBar">
                        <ul>
                            <li>
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <button type="submit">
                                            检索</button></div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                 <td colspan="4">
                    发货日期：
                    从<input name="DownlineDateFrom" class="date" type="text" value="<%=DownlineDateFrom %>" style="width:80px;"/>到<input
                        name="DownlineDateTo" type="text" class="date" value="<%=DownlineDateTo %>" style="width:80px;"/>
                </td>
                <td colspan="3">
                     旧件入库：
                    从<input name="InDateFrom" class="date" type="text" value="<%=InDateFrom %>" style="width:80px;"/>到<input
                        name="InDateTo" type="text" class="date" value="<%=InDateTo %>" style="width:80px;"/>
                </td>
            </tr>                        
        </table>
    </div>
    <div class="panelBar">
        <ul class="toolBar">
            <%if (HasPower(IHISCETeim.Web.Permission.新增))
                {%>
            <li><a class="add" href="UserModel/UClaimDemageListAdd.aspx" target="dialog" title="借件/供应商提供件"
                rel="UClaimDemageListAdd" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="450"><span>借件/供应商提供件</span></a></li>
            <%} %>
                       
            <% if (HasPower(IHISCETeim.Web.Permission.索赔件来往帐_旧件返回))
                {%>
            <li><a class="edit" href="UserModel/UClaimDemageUpdateInStock.aspx?ID={sid_user}" target="dialog"
                title="旧件返回确认" rel="UClaimDemageListEditInStock" max="false" mask="true" maxable="false" minable="false"
                resizable="true" drawable="true" width="850" height="500"><span>旧件返回</span></a></li>
            <%} %>

            <% if (HasPower(IHISCETeim.Web.Permission.删除))
                {%>
            <li><a class="delete" href="sysAjaxDone.ashx?ajaxmethod=DeleteUClaimDemageList&id={sid_user}"
                target="ajaxTodo" title="您确定要进行已退货操作吗?将会在信息平台删除此条记录,但不影响SAP相关记录"><span>已退货</span></a></li>
            <%} %>
                <% if (HasPower(IHISCETeim.Web.Permission.导出))
                {%>
            <li><a class="icon" href="UserModel/ExportExecl/ExportUClaimDemageList.aspx?orderField=<%=orderField %>&orderDirection=<%=orderDirection %>&DownlineDateFrom=<%=DownlineDateFrom %>&DownlineDateTo=<%=DownlineDateTo %>&CommonFiled=<%=CommonFiled %>&CommonValue=<%=CommonValue %>&ShowAgentName=<%= Server.UrlEncode( ShowAgentName) %>&UClaimType=<%=UClaimType %>&OnlyShow3MonthBefore=<%=OnlyShow3MonthBefore %>&InDateFrom=<%=InDateFrom %>&InDateTo=<%=InDateTo %>" target="_blank" title="确定要导出吗?"><span>导出</span></a></li>
            <%} %>

             <% if (HasPower(IHISCETeim.Web.Permission.查看))
                {%>
            <li><a class="add" href="UserModel/UClaimDemageGetWuPaiLi.aspx" target="navTab" title="旧件返回误判率"
                rel="UClaimDemageGetWuPaiLi" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="450"><span>旧件返回误判率</span></a></li>
            <%} %>

             <% if (HasPower(IHISCETeim.Web.Permission.查看))
                {%>
            <li><a class="add" href="UserModel/UClaimDemageGetInGuiFan.aspx" target="navTab" title="旧件返回规范"
                rel="UClaimDemageGetInGuiFan" max="false" mask="true" maxable="false" minable="false" resizable="false"
                drawable="true" width="850" height="450"><span>旧件返回规范</span></a></li>
            <%} %>
        </ul>
                   
    </div>
    <table class="list" width="1600"  layouth="106"  >
        <thead>           
        <tr  > 
            <th width="80px">SAP发货单号</th>  
            <th width="60px">&nbsp;</th>     
            <th align="left" width="100px">
                代理商
            </th>   
            <th width="100px"  <%=GetDataListOrder("ClaimsNumber") %>  >
                品情单号
            </th>        
            <th  <%=GetDataListOrder("SerialNumber") %>   width="100px">
                机号
            </th>            
            <th width="100px">
                物料号
            </th>         
            <th width="130px">
                物料名称
            </th>     
            <th width="60px" <%=GetDataListOrder("Quantity") %> >
                数量
            </th>  
            <th width="80px">小计(金额)</th>  
            <th width="90px">发货类型</th>  
            <th width="80px">
                发货单号
            </th> 
            <th width="80px">发货方式</th>
            <th width="80px" <%=GetDataListOrder("TaxDate") %>>
                发货日期
            </th>        
            <th width="80px" align="center">
                欠品数量
            </th>      
            <th width="80px" <%=GetDataListOrder("InDate") %>>
                旧件入库
            </th> 
            <th width="80px">
                数量
            </th>
            <th>误判数量</th>
        </tr>
        </thead>
        <tbody>
        <asp:repeater id="rpMenu" runat="server">
            <ItemTemplate>
           <tr target="sid_user" rel="<%# Eval("ID") %>"> 
            <td><%# Eval("DocNum")%></td>
            <td><%# Eval("U_OutTypeText")%></td>
            <td><%# Eval("AgentName")%></td>
            <td title="  <%# Eval("DocEntry")%>">
                <%# Eval("ClaimsNumber")%>
            </td>
			<td >
                <%# Eval("SerialNumber")%></td>          
			<td>
                <%# Eval("ItemCode")%>
            </td>
            <td>
                <%# Eval("Dscription")%>                
            </td>
            <td >
                <%# Eval("Quantity")%>
            </td>     
            <td ><%# Eval("LineTotal")%></td>   
            <td><%# Eval("UClaimType")%></td> 
            <td>
                <%# Eval("U_InvoiceNum")%>
            </td>
            <td>
               <b title="<%# Eval("SendRemark") %>" style="color:<%# Convert.ToBoolean(Eval("SendMsg")) || Eval("U_OutTypeText")=="索赔出库" ?"Green":"Red" %>;"> <%# Eval("U_ExpressMode")%></b>
            </td> 
            <td>
                <%# Convert.ToDateTime(Eval("TaxDate")).ToShortDateString()%>
            </td>         
            <td >
                <%# (Convert.ToDecimal(Eval("Quantity")) - Convert.ToDecimal(Eval("InQuantity"))).ToString("F2")%>
            </td>
            <td ><%# Eval("InDate") == DBNull.Value ? "&nbsp;" : Convert.ToDateTime(Eval("InDate")).ToShortDateString()%></td>
            <td><%# Convert.ToDecimal(Eval("InQuantity")).ToString("F2")%></td>
            <td style="color:<%# Convert.ToBoolean(Eval("IsPan"))?"":"red"%>;">
                <%# Eval("InWuPan")%>
            </td>
		</tr>
            </ItemTemplate>
            <FooterTemplate>   
            <tr class="totalitemtr"  > 
            <td colspan="7"  style=" text-align:right!important; font-weight:bold;" >
                合计:
            </td>     
            <td>
                <%=Convert.ToDecimal(GetUMDTValue("Quantity")).ToString("F2")%>
            </td>  
            <td  colspan="5" ><%=Convert.ToDecimal(GetUMDTValue("LineTotal")).ToString("F2")%></th>    
              
            <td colspan="2"  align="left">
                <%=Convert.ToDecimal(GetUMDTValue("needbackquantity")).ToString("F2")%>
            </td>      
           
            <td >
                <%=Convert.ToDecimal(GetUMDTValue("InQuantity")).ToString("F2")%>
            </td>
               <td>
                <%=Convert.ToDecimal(GetUMDTValue("InWuPan")).ToString("F2")%>
               </td>
        </tr> 
            </FooterTemplate> 
        </asp:repeater>
     </tbody>
   </table>
    <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                <%=SetnumPerPage() %>
            </select>
            <span>条，共<%=TotalCount%>条</span>
        </div>
        <div class="pagination" targettype="navTab" totalcount="<%=TotalCount%>" numperpage="<%=numPerPage %>"
            pagenumshown="10" currentpage="<%=pageNum %>">
        </div>
    </div>
</div>
</form>
